<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script type="text/javascript">

        // arguments.callee 指向自身引用
        var num = (function(n){
            if(n == 1 || n == 0){
                return 1;
            }
            return n * arguments.callee(n - 1);
        }(5));
        
    
        // func.caller

        function test() {
            demo();
        }

        function demo() {
            console.log(demo.caller); // 正在被哪个函数引用调用
        }

        test();
        console.log(demo.caller); //null
    </script>
</body>
</html>